package xyz.xxpc.springcloud.provider.web;

import org.springframework.web.bind.annotation.*;
import xyz.xxpc.springcloud.pojo.User;
import xyz.xxpc.springcloud.service.api.UserService;

import java.util.ArrayList;
import java.util.List;

@RestController
public class UserController implements UserService {

    @Override
    public List<User> queryAll() throws InterruptedException {
        Thread.sleep(500);
        List<User> users = new ArrayList<>();
        User user = new User();
        user.setUsername("zhangsan - sleep 500ms");
        user.setId(111);
        users.add(user);
        return users;
    }

    @Override
    public User query(Integer id) {
        return null;
    }

    @Override
    public User add(User user) {
        return null;
    }


}
